package com.weiweiqin.service.impl;

import com.weiweiqin.dao.GamelogDao;
import com.weiweiqin.model.Gamelog;
import com.weiweiqin.service.GamelogService;
import com.weiweiqin.vo.common.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class GamelogServiceImpl implements GamelogService {
	@Autowired
	private GamelogDao gamelogDao;

	public List<Gamelog> pageList(Page page, Map<String, Object> conditions) {
		return gamelogDao.pageList(page, conditions);
	}

	public int totalCount(Map<String, Object> conditions) {
		return gamelogDao.totalCount(conditions);
	}

	public void save(Gamelog gamelog) {
		gamelogDao.insert(gamelog);
		
	}

	public void update(Gamelog gamelog) {
		gamelogDao.update(gamelog);
		
	}

	public int getLastWinId(int goodsId) {
		return gamelogDao.getLastWinId(goodsId);
	}

	public int getFailNum(int id,int goodsId) {
		return gamelogDao.getFailNum(id,goodsId);
	}

	public int getAllNumByGoodsId(int goodsId) {
		return gamelogDao.getAllNumByGoodsId(goodsId);
	}

	public Gamelog get(int id) {
		return gamelogDao.get(id);
	}

	


}